1. Field of the Invention
The present invention relates to an image processing apparatus.
2. Description of the Related Art
An image processing apparatus performs variable-length compression on image data and stores the compressed image data in a page memory. Then, the image processing apparatus reads out the image data from the page memory and spools the image data in a hard disk drive. The page memory is, for example, a ring buffer. In the ring buffer, data is sequentially stored from the beginning of the storage area to the end thereof and, when the data reaches the end of the storage area, the subsequent data is stored from the beginning of the storage area.
However, in the case of an image processing apparatus that sequentially performs image processing on multiple pieces of band data composing image data, if the data subjected to the variable-length compression is stored in the ring buffer in the above-described manner, the position where the data is written reaches the end of the storage area at the time when part of the band data is stored in the ring buffer. As a result, the remaining part of the band data is written from the beginning of the ring buffer. Accordingly, the addresses of the storage positions become discontinuous in the middle of the band data and a delay occurs in writing and readout of the data in the discontinuous positions due to address calculation, thus causing a delay in the image processing. In particular, when the pieces of band data are sequentially subjected to pipeline processing in multiple image processing apparatuses, the efficiency of the pipeline processing is reduced if a delay occurs in the writing and readout of data into the memory.
When the compressed data has a fixed length, the discontinuity of the addresses of the storage positions does not occur in the middle of the compressed band data if the size of the storage area of the ring buffer is made an integral multiple of the size of the compressed band data. However, since the size of the data subjected to the variable-length compression is varied depending on the content of the data, the above-described problems occur.